package org.sunshinebox.team.exception;


public class MessageAwareException extends RuntimeException{
	
	private final ExceptionMessage msg;
	
	public MessageAwareException(ExceptionMessage msg) {
		this.msg = msg;
	}

	public MessageAwareException(ExceptionMessage msg, Exception cause) {
		super(cause);
		this.msg = msg;
	}
	
	public MessageAwareException(String msgId, Object... args) {
		this(null, msgId, args);
	}
	
	public MessageAwareException(Exception cause, String msgId, Object... args) {
		super(cause);
		this.msg = ExceptionMessageFactory.newInstance(msgId, args);
	}
	
	public ExceptionMessage getMsg() {
		return msg;
	}
	
}
